require File.join(File.dirname(__FILE__), 'dump.rb')

class Migrator
    def initialize(srcAddress, destAddress)
        @srcAddress = srcAddress
        @destAddress = destAddress
    end

    def migrate
        srcCache = MemCache.new(@srcAddress)
        destCache = MemCache.new(@destAddress)
        srcCache.slocs.each do |sloc|
            srcCache.keys(sloc).each do |key|
                key, flags, value = srcCache.fetchDetails(key)
		if key != nil then
                destCache.storeDetail(key, flags, 0, value)
		end
            end
        end
    end
end
